<?php

declare(strict_types=1);

namespace App\Request\ai;

use Hyperf\Validation\Request\FormRequest;

/**
 * 模型厂商验证器
 */
class ManufacturerRequest extends FormRequest
{

    protected array $scenes = [
        'create' => ['name', 'apikey', 'remark'],
        'update' => ['id', 'name', 'apikey', 'remark'],
        'delete' => ['id'],
    ];

    public function authorize(): bool
    {
        return true;
    }


    public function rules(): array
    {
        return [
            'id'=>'integer|required',
            'name'=>'string|required',
            'apikey'=>'string|required',
            'remark'=>'string|required',
        ];
    }

    public function messages(): array
    {
        return [
            'id.integer'=>'请输入正确的ID',
            'id.required'=>'请输入ID',
            'name.string'=>'请输入正确的名称',
            'name.required'=>'请输入名称',
            'apikey.string'=>'请输入正确的apikey',
            'apikey.required'=>'请输入apikey',
            'remark.string'=>'请输入正确的备注',
            'remark.required'=>'请输入备注',
        ];
    }
}
